home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / PAL.PAK / PALCTL.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  95 lines

  1. // palctl.h : Declaration of the CPalCtrl OLE control class.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. /////////////////////////////////////////////////////////////////////////////
  14. // Error codes
  15.  
  16. #define PAL_E_CANTRESIZEPALETTE CUSTOM_CTL_SCODE(32002) // Can't resize palette
  17.  
  18.  
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CPalCtrl : See palctl.cpp for implementation.
  21.  
  22. class CPalCtrl : public COleControl
  23. {
  24.     DECLARE_DYNCREATE(CPalCtrl)
  25.  
  26. // Constructor
  27. public:
  28.     CPalCtrl();
  29.  
  30. // Overrides
  31.  
  32.     // Drawing function
  33.     virtual void OnDraw(
  34.                 CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  35.  
  36.     // Persistence
  37.     virtual void DoPropExchange(CPropExchange* pPX);
  38.  
  39.     // Reset control state
  40.     virtual void OnResetState();
  41.  
  42.     // Serialization
  43.     virtual void Serialize(CArchive& ar);
  44.  
  45.     BOOL OnMapPropertyToPage(DISPID dispid, LPCLSID lpclsid, BOOL* pbPageOptional);
  46.  
  47. // Implementation
  48. protected:
  49.     ~CPalCtrl();
  50.  
  51.     DECLARE_OLECREATE_EX(CPalCtrl)  // Class factory and guid
  52.     DECLARE_OLETYPELIB(CPalCtrl)        // GetTypeInfo
  53.     DECLARE_PROPPAGEIDS(CPalCtrl)       // Property page IDs
  54.     DECLARE_OLECTLTYPE(CPalCtrl)        // Type name and misc status
  55.  
  56. // Message maps
  57.     //{{AFX_MSG(CPalCtrl)
  58.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  59.     //}}AFX_MSG
  60.     DECLARE_MESSAGE_MAP()
  61.  
  62. // Dispatch maps
  63.     //{{AFX_DISPATCH(CPalCtrl)
  64.     afx_msg short GetLength();
  65.     afx_msg void SetLength(short nNewValue);
  66.     afx_msg OLE_HANDLE GetHandle();
  67.     afx_msg LPPICTUREDISP GetPicture();
  68.     afx_msg void SetPicture(LPPICTUREDISP newValue);
  69.     afx_msg OLE_COLOR GetEntry(short nIndex);
  70.     afx_msg void SetEntry(short nIndex, OLE_COLOR newValue);
  71.     //}}AFX_DISPATCH
  72.     DECLARE_DISPATCH_MAP()
  73.  
  74.     afx_msg void AboutBox();
  75.  
  76. // Event maps
  77.     //{{AFX_EVENT(CPalCtrl)
  78.     //}}AFX_EVENT
  79.     DECLARE_EVENT_MAP()
  80.  
  81. // Dispatch and event IDs
  82. public:
  83.     enum {
  84.     //{{AFX_DISP_ID(CPalCtrl)
  85.     dispidLength = 1L,
  86.     dispidHandle = 2L,
  87.     dispidPicture = 3L,
  88.     dispidEntry = 4L,
  89.     //}}AFX_DISP_ID
  90.     };
  91.  
  92. // Data Members
  93.     CPalette *m_iPalette;
  94. };
  95.